package com.huage.courseplatform.application.model.param;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;
import java.io.Serializable;


@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="商户管理参数",description="商户管理参数")
public class BusinessManagePARAM implements Serializable {
    private static final long serialVersionUID = 1L;

    @NotEmpty(message = "id不能为空", groups = Update.class)
    @ApiModelProperty(value = "id(更新可以不传)",required = true)
    private String id;

    @NotEmpty(message = "商户名不能为空", groups = {Update.class, Insert.class})
    @ApiModelProperty(value = "商户名",required = true)
    private String businessName;

    @Email(message = "请输入正确的邮箱",groups = {Update.class, Insert.class})
    @ApiModelProperty(value = "邮箱")
    private String businessEmail;


    @ApiModelProperty(value = "联系电话")
    private String businessPhone;


    @ApiModelProperty(value = "商户头像ID")
    private String logoImg;

    @NotEmpty(message = "详细地址不能为空", groups = {Update.class, Insert.class})
    @ApiModelProperty(value = "详细地址",required = true)
    private String address;

    @Min(value = -180,message = "经度不能小于-180", groups = {Insert.class,Update.class})
    @Max(value = 180,message = "经度不能大于180",  groups = {Insert.class,Update.class})
    @ApiModelProperty(value = "经度-180~180")
    private Integer longitude;

    @Min(value = -90,message = "纬度不能小于-90", groups = {Insert.class,Update.class})
    @Max(value = 90,message = "纬度不能大于90", groups = {Insert.class,Update.class})
    @ApiModelProperty(value = "纬度-90~90")
    private Integer latitude;

    @NotNull(message = "商户状态不能为空", groups = {Update.class, Insert.class})
    @ApiModelProperty(value = "商户状态 0：账号注销，1：正常使用，2：封禁，3：审核中",required = true)
    private Integer status;

    @NotEmpty(message = "商户介绍不能为空", groups = {Update.class, Insert.class})
    @ApiModelProperty(value = "商户介绍",required = true)
    private String description;

    @ApiModelProperty(value = "备注")
    private String remark;


}
